package com.sc.design.memento;

/**
 * @author sc
 * Created on  2017/12/6
 */
public class Client {
    public static void main(String[] args) {
        Boy boy = new Boy();
        CareTaker careTaker = new CareTaker();

        boy.setState("心情好");
        System.out.println(boy.getState());

        careTaker.setMemento(boy.createMemento());

        boy.changeState();
        System.out.println(boy.getState());

        boy.restore(careTaker.getMemento());
        System.out.println(boy.getState());
    }
}
